package com.chen.testfluentvalidator;

import com.baidu.unbiz.fluentvalidator.Validator;
import com.baidu.unbiz.fluentvalidator.ValidatorContext;
import com.baidu.unbiz.fluentvalidator.ValidatorHandler;

/**
 *车位校验
 *@author：email: <a href="cyb@ewppay.com"> Administrator </a> 
 *@Date 2017-4-24 下午3:56:22 
 */

public class CarSeatCountValidator extends ValidatorHandler<Integer> implements Validator<Integer>{

	@Override
	public boolean validate(ValidatorContext context, Integer t) {
		if (t < 2) {
            context.addErrorMsg(String.format("Seat count is not valid, invalid value=%s", t));
            return false;
        }
        return true;
	}
	
}
